//package com.example.demo.server;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.OutputStream;
//import java.net.ServerSocket;
//import java.net.Socket;
//import java.util.logging.Handler;
//
//
//
//public class server {
//    public static void main(String[] args) throws Exception {
//        ServerSocket ss = new ServerSocket(8080);
//        System.out.println("server is running");
//        while (true){
//            Socket sock = ss.accept();
//            System.out.println("connected from" + sock.getRemoteSocketAddress());
//
//            Thread t = new H andler(sock);
//            t.start();
//        }
//    }
//}
//class Handler extends Thread{
//    Socket sock;
//    public Handler(Socket sock){
//        this.sock = sock;
//    }
//    public void run(){
//        try {
//            InputStream input = this.sock.getInputStream();
//         OutputStream output = this.sock.getOutputStream();
//                handle(input,output);
//        } catch (Exception e) {
//            try {
//                this.sock.close();
//            } catch (IOException ioe) {
//            }
//            System.out.println("client disconnected");
//        }
//    }
//
//    private void handle(InputStream input, OutputStream output) {
//
//    }
//}